﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PowerDelivery
{
    public partial class Login : Form
    {
        public Login()
        {
            InitializeComponent();
        }

        private void btnLogar_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void Login_Load(object sender, EventArgs e)
        {
            populalista();
            cboUsuario.ValueMember = "Nome";
            cboUsuario.DisplayMember = "Nome";

            cboUsuario.DataSource = lUser;
        }

        private List<usuario> lUser;
        private void populalista()
        {
            lUser = new List<usuario>();
            usuario uu = new usuario();
            uu.ID = 1;
            uu.Nome = "Master";
            uu.senha = "senha";
            uu.nivel = 10;

            lUser.Add(uu);
            uu = new usuario();
            uu.ID = 2;
            uu.Nome = "Supervisor";
            uu.senha = "senha";
            uu.nivel = 5;
            lUser.Add(uu);

            uu = new usuario();
            uu.ID = 3;
            uu.Nome = "Usuario";
            uu.senha = "senha";
            uu.nivel = 1;
            lUser.Add(uu);

        }

    }

    public class usuario
    {
        public int ID { get; set; }
        public string Nome { get; set; }
        public string senha { get; set; }
        public int nivel { get; set; }
    }
}
